<%inherit file="../frame.html"/> 



<%def name="title()">Kanban</%def>

<%def name="body_frame()">
% for task in tasks['todo']:
	<li class="ui-state-default"><span class="ui-icon ui-icon-arrowthick-2-n-s"></span>
		<div>
			<span><a href='/kanban/${task["_id"]}/detail'>${task['name']}</a></span>
			<span>${task['priority']}</span>
			<span>${task['owner']}</span>
			<span>${task['desc']}</span>
			<span>${task.get('start_time')}</span>
		</div>
	</li>
% endfor

	<style>
		.sortable { list-style-type: none; margin: 0; padding: 0; width: 60%; }
		.sortable li { margin: 0 3px 3px 3px; padding: 0.4em; padding-left: 1.5em; font-size: 1.4em; height: 160px; width: 260px;}
	</style>
<script>
	

$(function() {
	$( ".sortable" ).sortable();
	$( ".sortable" ).disableSelection();
});
	$(function() {
		$( "button" ).button();
		$( "button" ).click(function() { 
			$(function() {
				$( "#dialog" ).dialog({
					   close: function(event, ui) { 
						   $.ajax({ url: "add", data:{
							   name: $("input[name='name']").val(),
							   name: $("input[name='desc']").val(),
						   },
						   dataType:'json',
						   success: function(ret){
					        	alert("ok" + ret.id);
					      }});
					   }
				});
			});
			
			return false; 
		});
	});
	
	</script>




	<button>Add</button>
	<div id="dialog" title="添加任务" style="display:none;">
		<input name="name">
		<input name="desc">
	</div>

</%def>
